//
//  BusinessInfoCollectionViewCell.m
//  Globalstone
//
//  Created by 刘建峰 on 16/8/8.
//  Copyright © 2016年 yuf. All rights reserved.
//

#import "BusinessInfoCollectionViewCell.h"

@implementation BusinessInfoCollectionViewCell

- (void)awakeFromNib {
    // Initialization code
    [self adaptiveViewLayout:self];
}
#pragma mark - 调整自适应布局
- (void)adaptiveViewLayout:(UIView *)viewLayout {
    for (UIView *view in viewLayout.subviews) {
        view.frame = flexibleFrame(view.frame, NO);
        if ([view isKindOfClass:[UITextField class]]) {
            UITextField *viewField = (UITextField *)view;
            CGFloat fontSize = viewField.font.pointSize;
            viewField.font = [UIFont systemFontOfSize:fontSize*VerticalTexeRatio()];
            viewField.text = InternationalControl(viewField.text);
            viewField.placeholder = InternationalControl(viewField.placeholder);
        }else if ([view isKindOfClass:[UILabel class]]){
            UILabel *viewLabel = (UILabel *)view;
            CGFloat fontSize = viewLabel.font.pointSize;
            viewLabel.font = [UIFont systemFontOfSize:fontSize*VerticalTexeRatio()];
            viewLabel.text = InternationalControl(viewLabel.text);
            
        }else if ([view isKindOfClass:[UIButton class]]){
            UIButton *viewButton = (UIButton *)view;
            CGFloat fontSize = viewButton.titleLabel.font.pointSize;
            viewButton.titleLabel.font = [UIFont systemFontOfSize:fontSize*VerticalTexeRatio()];
            [viewButton setTitle:InternationalControl(viewButton.titleLabel.text) forState:UIControlStateNormal] ;
        }
        UIView *vv =view;
        for (UIView *view in vv.subviews) {
            view.frame = flexibleFrame(view.frame, NO);
            if ([view isKindOfClass:[UITextField class]]) {
                UITextField *viewField = (UITextField *)view;
                CGFloat fontSize = viewField.font.pointSize;
                viewField.font = [UIFont systemFontOfSize:fontSize*VerticalTexeRatio()];
                viewField.text = InternationalControl(viewField.text);
                viewField.placeholder = InternationalControl(viewField.placeholder);
                
            }else if ([view isKindOfClass:[UILabel class]]){
                UILabel *viewLabel = (UILabel *)view;
                CGFloat fontSize = viewLabel.font.pointSize;
                viewLabel.font = [UIFont systemFontOfSize:fontSize*VerticalTexeRatio()];
                viewLabel.text = InternationalControl(viewLabel.text);
                
            }else if ([view isKindOfClass:[UIButton class]]){
                UIButton *viewButton = (UIButton *)view;
                CGFloat fontSize = viewButton.titleLabel.font.pointSize;
                viewButton.titleLabel.font = [UIFont systemFontOfSize:fontSize*VerticalTexeRatio()];
                [viewButton setTitle:InternationalControl(viewButton.titleLabel.text) forState:UIControlStateNormal] ;
            }
        }
    }
}

@end
